

using CustomStreams;
using System.IO;
using System;

class Application
{

	static void Main()
	{

		UpperCaseStream customStream;
		
		// Create our custom stream, passing it a file stream 

		customStream = new UpperCaseStream( new FileStream( "file.txt", FileMode.Open ) );
		StreamReader sr = new StreamReader( customStream );
		Console.WriteLine("{0}",sr.ReadToEnd() );
		customStream.Close();

		// Create a file using our custom stream (using ASCII encoding)

		customStream = new UpperCaseStream( new FileStream( "fileout.txt", FileMode.Create ) );
		StreamWriter sw = new StreamWriter( customStream,  System.Text.Encoding.ASCII );

		int i;

		for (i=0;i<100;i++)
			sw.WriteLine("Hello World!");
		sw.Close();
	}
}